<?php 
	session_start();
	require_once("../includes/public.inc.php");
	$type = isset($_GET['type'])?$_GET['type']:'';
	$username = isset($_SESSION['username'])?$_SESSION['username']:'';
	if (empty($username))
	{
		echo "<script>alert('亲你还没有登录哦');history.back();</script>";	exit;
	}
	if ($type=='dg')
	{
		$user = $exist_user = mysql_fetch_array(mysql_query("select * from ".DBQIAN."daogou where username='".$username."' order by id desc limit 1"));
	}
	else 
	{
		$user = $exist_user = mysql_fetch_array(mysql_query("select * from ".DBQIAN."users where username='".$username."' order by id desc limit 1"));
	}
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,user-scalable=no,maximum-scale=1,initial-scale=1">
<title>会员中心</title>
<link rel="stylesheet" type="text/css" href="images/person/index.css" media="all">
</head>
<body>
	<div class="pz-css">
	    <form action="zhuanqu.php?act=list&type=<?=$type?>" id="frm" method="post">
		<div class="pz-panel">
			<div class="group">
				  <h4><?=$username?>：&nbsp;您好，欢迎回来！</h4>
				  <?if ($type!="dg"){?><h5>我的积分：&nbsp;<?=$user['credit']?></h5><?}?>
                   <h5>身份：&nbsp;<?if ($type=="dg"){?>导购员<?}else{?> 会员	<?}?></h5>
				  <?if ($type!="dg"){?><p style="font-size: 90%; padding-top: 5px; text-align: right;">想获得更多积分？<button type="submit" class="red">赚取积分</button>
				  </p><?}?>
			 </div>
		</div>
		</form>
		<div class="group">
			<span class="span4"><button onclick="location.href='geren.php?type=<?=$type?>'">个人信息</button></span>
			<span class="span4"><button onclick="location.href='xiugai.php?type=<?=$type?>'">修改密码</button></span>
			<span class="span4"><button onclick="location.href='login.php?act=logout&type=<?=$type?>'">退出登录</button></span>
		</div>
		<div class="list" style="padding: 5px;">
		<?if ($type == 'dg'){?>
			<a href="rules_detail.php?type=<?=$type?>&id=1" class="item"><img src="images/person/m_5.png"/>领红包规则</a>
			<a href="dgpx.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>导购培训</a>
			<a href="hd.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>促销活动</a>
			<a href="hbrecord.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>红包领取记录</a>
		<?}else{?>
			<!-- <a href="../index.php" class="item"><img src="images/person/m_1.png">企业平台</a> -->
			<a href="zhuanqu.php?act=list&type=<?=$type?>" class="item"><img src="images/person/m_2.png"/>赚取积分</a>
			<a href="rules.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>规则说明</a>
			<a href="hd.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>促销活动</a>
  			<a href="creditshop.php?type=<?=$type?>" class="item"><img src="images/person/m_3.png"/>礼品兑换</a>       
			<a href="ticketbonus.php?type=<?=$type?>" class="item"><img src="images/person/m_3.png"/>积分抽奖</a>     
			<a href="creditrecord.php?type=<?=$type?>" class="item"><img src="images/person/m_4.png"/>积分记录</a>
			<a href="exchange.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>兑换记录</a>
		<?}?>
			<a href="product.php?type=<?=$type?>" class="item"><img src="images/person/m_5.png"/>产品知识</a>
		</div>
		
		<div class="frame" style="display: none;">
			<p style="font-size: 10pt; text-align: center;">技术支持<a style="color: rgb(51, 153, 255);" href="http://www.xf12315.net/">品真防伪</a></p>
		</div>
	</div>
</body>
</html>